

public class text3 {
    public static void main(String[] args) {
        int n = 2;
        for ( ; n < 20; n++) {
            int i = 2;
            for (; i < Math.sqrt(n) ; i++) {
                if (n % i == 0){
                    break;
                }
            }
            if (i > Math.sqrt(n)) {
                System.out.println(n+"是素数");
            } else {
                System.out.println(n+"不是素数");
            }
        }
    }
}
